<?php

/**
 * Proveedor form.
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ProveedorForm extends BaseProveedorForm
{
  public function configure()
  {
      
       //Eliminar los campos del formularios  created_at y updated_at
      unset (
        
        $this['created_at'],
        $this['updated_at']

      );
      
      
      $this->widgetSchema['empresa_id'] = new sfWidgetFormInputHidden(array(),array('value'=> sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')));
      
       $this->widgetSchema['pais_id'] = new sfWidgetFormDoctrineChoice(array(
                    'model'     => 'Pais',
      ));
      
      $this->widgetSchema['entidad_id'] = new sfWidgetFormDoctrineDependentSelect(array(
	            'model'     => 'Entidad',
                    'depends'   => 'Pais',
                    'table_method' => 'getNombre',
                    'add_empty' => 'Seleccione Entidad',
      ));

      $this->widgetSchema['municipio_id'] = new sfWidgetFormDoctrineDependentSelect(array(
	            'model'     => 'Municipio',
                    'depends'   => 'Entidad',
                    'add_empty' => 'Seleccione Municipio',
                    'table_method' => 'getNombre',
                    'order_by' => array('nombre','asc')
      ));
      
        $this->widgetSchema['parroquia_id'] = new sfWidgetFormDoctrineDependentSelect(array(
	            'model'     => 'Parroquia',
                    'depends'   => 'Municipio',
                    'add_empty' => 'Seleccione Municipio',
                    'table_method' => 'getNombre',
                    'order_by' => array('nombre','asc')
      ));
        
     $this->widgetSchema['direccion_fiscal'] = new sfWidgetFormTextarea();
     $this->widgetSchema['direccion_fisica'] = new sfWidgetFormTextarea();
      
      
  }
}
